<template>
  <div>
    <button @click="up">updateName</button>
    <h2>{{ name }}</h2>
    <h2>{{ age }}</h2>
    <h2>{{ gender }}</h2>
  </div>
</template>

<script>
import { mapState } from "vuex";
console.log();
export default {
  computed: {
    ...mapState(["name", "age", "gender"]),
  },
  methods: {
    up() {
      this.$store.commit('updateName', 'chann')
    },
  },
};
</script>

<style lang="scss" scoped>
</style>